home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Found / FWCommon / FWErrors.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  8.8 KB  |  213 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWErrors.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWERRORS_H
  11. #define FWERRORS_H
  12.  
  13. #if defined(FW_BUILD_MAC) && !defined(__ERRORS__)
  14. #include <Errors.h>
  15. #endif
  16.  
  17. #ifndef SOM_Module_OpenDoc_Errors_defined
  18. #include <ErrorDef.xh>
  19. #endif
  20.  
  21. //========================================================================================
  22. //  Type definitions
  23. //========================================================================================
  24.  
  25. typedef     long            FW_PlatformError;
  26.  
  27. //========================================================================================
  28. //  Platform Error constants, to be moved to FWErrors.h
  29. //========================================================================================
  30.  
  31. // Note that ODF always uses symbolic constants for error codes, but the physical values 
  32. // of the error codes may vary across platforms. Wherever possible, ODF attempts to use
  33. // standard error codes already defined for the platform.  ODF defines new error codes
  34. // only when no previously existing error platform error code is appropriate.
  35.  
  36. // On the Macintosh, the ODF project has 
  37. // been allocated the OSErr error code range of -30200 to -30259 (inclusive).  In ODF1
  38. // Most symbolic error constants are defined to be based upon their Macintosh values.
  39. // In future releases, we may use conditional code to assign platform specific values
  40. // to more of the error codes.  ODF developers should not rely on the specific values of 
  41. // of any error codes 
  42.  
  43. const FW_PlatformError FW_xFirstODFError            = -30200;
  44. const FW_PlatformError FW_xLastODFError                = -30259;
  45.  
  46. const FW_PlatformError FW_xLastUsedODFError            = -30214; //FW_xInvalidPictureData
  47.  
  48. // ===== FWCommon Errors =====
  49.  
  50. const FW_PlatformError FW_xNoError = 0;
  51.     // Not an error, i.e. success.
  52.     
  53. const FW_PlatformError FW_xUnknownError = -30200;
  54.     // An error occured within ODF that could not be attributed to a more specific
  55.     // cause.  ODF uses this error only when it has no other choice.
  56.     
  57. // ===== FWCollec Errrors
  58.  
  59. const FW_PlatformError FW_xBadInsert = -30201;
  60.     // Error occured inserting item into a sorted array.
  61.     // This error should only occur if the private interface to sorted array is misused.
  62.     // The error should not happen to clients of FW_TMap<key, value>.
  63.     
  64. const FW_PlatformError FW_xBadRemove = -30202;
  65.     // Error occured removing an item from a sorted array.
  66.  
  67. // ===== FWMemory Errors
  68.  
  69. #if defined(FW_BUILD_MAC)
  70. const FW_PlatformError FW_xMemoryExhausted = memFullErr;
  71. #elif defined(FW_BUILD_WIN)
  72. const FW_PlatformError FW_xMemoryExhausted = -30999; //!!!JEL: Need correct value!!!
  73. #endif
  74.  
  75. // ===== FWStream Errors
  76.  
  77. const FW_PlatformError FW_xReadableStream = -30202;
  78.     // An error occured while reading from a stream.  Most probable cause is unexpected
  79.     // end of sink while attemping to read a value such as a nul terminated string.
  80.  
  81. const FW_PlatformError FW_xWritableStream = -30203;
  82.     // An error occured while writing to a stream.  Most probable cause is sink full.
  83.     
  84. const FW_PlatformError FW_xCorruptArchiveStream = -30204;
  85.     // An error occured while reading from a stream containing an archive of objects.
  86.     // One likely cause is that an archivable class has not defined it's create/initialize
  87.     // archiving functions to be consistent with it output archiving function.  If, say,
  88.     // the initialize function for a class reads too much or too little data, then the
  89.     // stream will not be left pointing at a meaningful location, and the next attempt
  90.     // by the archiver to read metadata will result in bad metadata.
  91.  
  92. // ===== FWString Errors
  93.  
  94. const FW_PlatformError FW_xStringResourceNotFound = -30205;
  95.     // No string with the given id was found in the resource
  96.  
  97. // ===== FWGraphx Errors
  98.  
  99. const FW_PlatformError FW_xPrintingCanceled     = -30206;
  100. const FW_PlatformError FW_xNoDefaultPrinter     = -30207;
  101. const FW_PlatformError FW_xGraphicException        = -30212;
  102. const FW_PlatformError FW_xInvalidBitmapData     = -30213;
  103. const FW_PlatformError FW_xInvalidPictureData     = -30214;
  104.  
  105. // ===== FWFiles Errors
  106.  
  107. const FW_PlatformError FW_xCantDeleteWorkingDirectory = -30208;
  108. const FW_PlatformError FW_xInvalidDirectory           = -30209;
  109.  
  110. #ifdef FW_BUILD_MAC
  111. const FW_PlatformError FW_xAFPAccessDenied = afpAccessDenied;
  112. const FW_PlatformError FW_xAFPDenyConflict = afpDenyConflict;
  113. const FW_PlatformError FW_xAFPObjectTypeErr = afpObjectTypeErr;
  114. const FW_PlatformError FW_xBadFileName = bdNamErr;
  115. const FW_PlatformError FW_xDirectoryBusy = fBsyErr;
  116. const FW_PlatformError FW_xDirectoryFull = dirFulErr;
  117. const FW_PlatformError FW_xDiskFull = dskFulErr;
  118. const FW_PlatformError FW_xEndOfFileReached = eofErr;
  119. const FW_PlatformError FW_xFileBusy = fBsyErr;
  120. const FW_PlatformError FW_xFileExists = dupFNErr;
  121. const FW_PlatformError FW_xFileLocked = fLckdErr;
  122. const FW_PlatformError FW_xNoFileFound = fnfErr; 
  123. const FW_PlatformError FW_xFileNotOpen = fnOpnErr;
  124. const FW_PlatformError FW_xGeneralIOError = ioErr;
  125. const FW_PlatformError FW_xGetFPosError = gfpErr;
  126. const FW_PlatformError FW_xInvalidAccess = wrPermErr;
  127. const FW_PlatformError FW_xInvalidFileReference = rfNumErr;
  128. const FW_PlatformError FW_xNoSuchVolume = nsvErr; 
  129. const FW_PlatformError FW_xNotAnHFSVolume = wrgVolTypErr;
  130. const FW_PlatformError FW_xParameterError = paramErr;
  131. const FW_PlatformError FW_xPathNotFound = dirNFErr; 
  132. const FW_PlatformError FW_xPermissionError = permErr;
  133. const FW_PlatformError FW_xRenameError = fsRnErr;
  134. const FW_PlatformError FW_xSeekError = posErr;
  135. const FW_PlatformError FW_xSharingViolation = opWrErr;
  136. const FW_PlatformError FW_xTooManyOpenFiles = tmfoErr;
  137. const FW_PlatformError FW_xVolumeLocked = vLckdErr;
  138. const FW_PlatformError FW_xWriteProtect = wPrErr;
  139. #endif
  140.  
  141. #ifdef FW_BUILD_WIN16
  142. const FW_PlatformError FW_xNoError = 0; 
  143. const FW_PlatformError FW_xBadFileName = 123;
  144. const FW_PlatformError FW_xDirectoryBusy = 16;
  145. const FW_PlatformError FW_xDirectoryFull = 82;
  146. const FW_PlatformError FW_xDiskFull = 39;
  147. const FW_PlatformError FW_xEndOfFileReached = 38;
  148. const FW_PlatformError FW_xFileExists = 80;
  149. const FW_PlatformError FW_xFileLocked = 33;
  150. const FW_PlatformError FW_xNoFileFound = 2; 
  151. const FW_PlatformError FW_xFileNotOpen = 1006; 
  152. const FW_PlatformError FW_xGeneralIOError = 31;
  153. const FW_PlatformError FW_xInvalidAccess = 12;
  154. const FW_PlatformError FW_xInvalidFileReference = 6;
  155. const FW_PlatformError FW_xNoSuchVolume = 15; 
  156. const FW_PlatformError FW_xParameterError = 87;
  157. const FW_PlatformError FW_xPathNotFound = 3; 
  158. const FW_PlatformError FW_xPermissionError = 5;
  159. const FW_PlatformError FW_xReadFault = 30;
  160. const FW_PlatformError FW_xSeekError = 25;
  161. const FW_PlatformError FW_xSharingViolation = 32;
  162. const FW_PlatformError FW_xTooManyOpenFiles = 4;
  163. const FW_PlatformError FW_xWriteFault = 29;
  164. const FW_PlatformError FW_xWriteProtect = 19;
  165. #endif
  166.  
  167. #ifdef FW_BUILD_WIN32
  168. const FW_PlatformError FW_xNoError = NO_ERROR; 
  169. const FW_PlatformError FW_xBadFileName = ERROR_INVALID_NAME;
  170. const FW_PlatformError FW_xDirectoryBusy = ERROR_CURRENT_DIRECTORY;
  171. const FW_PlatformError FW_xDirectoryFull = ERROR_CANNOT_MAKE;
  172. const FW_PlatformError FW_xDiskFull = ERROR_HANDLE_DISK_FULL;
  173. const FW_PlatformError FW_xEndOfFileReached = ERROR_HANDLE_EOF;
  174. const FW_PlatformError FW_xFileExists = ERROR_FILE_EXISTS;
  175. const FW_PlatformError FW_xFileLocked = ERROR_LOCK_VIOLATION;
  176. const FW_PlatformError FW_xNoFileFound = ERROR_FILE_NOT_FOUND; 
  177. const FW_PlatformError FW_xFileNotOpen = ERROR_FILE_INVALID; 
  178. const FW_PlatformError FW_xGeneralIOError = ERROR_GEN_FAILURE;
  179. const FW_PlatformError FW_xInvalidAccess = ERROR_INVALID_ACCESS;
  180. const FW_PlatformError FW_xInvalidFileReference = ERROR_INVALID_HANDLE;
  181. const FW_PlatformError FW_xNoSuchVolume = ERROR_INVALID_DRIVE; 
  182. const FW_PlatformError FW_xParameterError = ERROR_INVALID_PARAMETER;
  183. const FW_PlatformError FW_xPathNotFound = ERROR_PATH_NOT_FOUND; 
  184. const FW_PlatformError FW_xPermissionError = ERROR_ACCESS_DENIED;
  185. const FW_PlatformError FW_xReadFault = ERROR_READ_FAULT;
  186. const FW_PlatformError FW_xSeekError = ERROR_SEEK;
  187. const FW_PlatformError FW_xSharingViolation = ERROR_SHARING_VIOLATION;
  188. const FW_PlatformError FW_xTooManyOpenFiles = ERROR_TOO_MANY_OPEN_FILES;
  189. const FW_PlatformError FW_xWriteFault = ERROR_WRITE_FAULT;
  190. const FW_PlatformError FW_xWriteProtect = ERROR_WRITE_PROTECT;
  191. #endif
  192.  
  193. // ===== FWGraphics Errors
  194.  
  195. #ifdef FW_BUILD_MAC
  196. const FW_PlatformError FW_xRegionOverflow = rgnTooBigErr;
  197. #else
  198. const FW_PlatformError FW_xRegionOverflow = -500; // !!! Need a better assignment
  199. #endif
  200.  
  201. // ===== FWResour Errors
  202.  
  203. const FW_PlatformError FW_xResourceFileNotFound            = -30210;
  204. const FW_PlatformError FW_xResourceNotLoaded            = -30211;
  205.  
  206. #ifdef FW_BUILD_MAC
  207. const FW_PlatformError FW_xResourceNotFound                = resNotFound;
  208. #else
  209. const FW_PlatformError FW_xResourceNotFound                = FW_xResourceNotLoaded;// !!! Need a better assignment
  210. #endif
  211.  
  212. #endif
  213.